package net.tobby.acm.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.tobby.acm.db.mysql.HouseService;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created with IntelliJ IDEA. User: tangb Date: 4/20/12 Time: 3:19 PM To change
 * this template use File | Settings | File Templates.
 */

@Controller
@RequestMapping("/house")
public class HelloWorldController {

	@Resource(name = "houseService")
	private HouseService houseService;

	@RequestMapping(value = "/viewHouse")
	public ModelAndView add(HttpServletRequest request, HttpServletResponse response) throws Exception {

		System.out.println("houseService: " + houseService);
		Map<String, Object> paraMap = new HashMap<String, Object>();

		System.out.println("/addCustomer");
		return new ModelAndView("welcome");

	}

	@RequestMapping(value = "/deleteCustomer")
	public ModelAndView delCustomer(HttpServletRequest request, HttpServletResponse response) throws Exception {

		System.out.println("/customer/deleteCustomer");
		return new ModelAndView("CustomerAddView");

	}

	@RequestMapping(value = "/listHouse")
	public ModelAndView listHouse(HttpServletRequest request, HttpServletResponse response) throws Exception {

		System.out.println("/customer/listHouse");
		return new ModelAndView("CustomerAddView");

	}

}
